//
//  DDCommonDataModel.m
//  DingDongZP
//
//  Created by Jyh on 16/4/28.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDCommonDataModel.h"

@class DDCityModel;

static NSString * const kEduIdKey = @"eduId";
static NSString * const kEduTextKey = @"eduText";

static NSString * const kSalaryIdKey = @"SalaryId";
static NSString * const kSalaryTextKey = @"SalaryText";

static NSString * const kExperienceIdKey = @"ExperienceId";
static NSString * const kExperienceTextKey = @"ExperienceText";

static NSString * const kCompanySizeIdKey = @"CompanySizeId";
static NSString * const kCompanySizeTextKey = @"CompanySizeText";

static NSString * const kProvinceIdKey = @"ProvinceId";
static NSString * const kProvinceTextKey = @"ProvinceText";

static NSString * const kCityIdKey = @"CityId";
static NSString * const kCityTextKey = @"CityText";

@implementation DDCommonDataModel

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"cities" : [DDCityModel class]};
}


- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.edu_id forKey:kEduIdKey];
    [aCoder encodeObject:self.edu_text forKey:kEduTextKey];
    
    [aCoder encodeObject:self.salary_id forKey:kSalaryIdKey];
    [aCoder encodeObject:self.salary_text forKey:kSalaryTextKey];
    
    [aCoder encodeObject:self.experience_id forKey:kExperienceIdKey];
    [aCoder encodeObject:self.experience_text forKey:kExperienceTextKey];
    
    [aCoder encodeObject:self.companysize_id forKey:kCompanySizeIdKey];
    [aCoder encodeObject:self.companysize_text forKey:kCompanySizeTextKey];
    
    [aCoder encodeObject:self.province_id forKey:kProvinceIdKey];
    [aCoder encodeObject:self.province_name forKey:kProvinceTextKey];
    
}
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _edu_id = [aDecoder decodeObjectForKey:kEduIdKey];
        _edu_text = [aDecoder decodeObjectForKey:kEduTextKey];
        
        _salary_id = [aDecoder decodeObjectForKey:kSalaryIdKey];
        _salary_text = [aDecoder decodeObjectForKey:kSalaryTextKey];
        
        _experience_id = [aDecoder decodeObjectForKey:kExperienceIdKey];
        _experience_text = [aDecoder decodeObjectForKey:kExperienceTextKey];

        _companysize_id = [aDecoder decodeObjectForKey:kCompanySizeIdKey];
        _companysize_text = [aDecoder decodeObjectForKey:kCompanySizeTextKey];

        _province_id = [aDecoder decodeObjectForKey:kProvinceIdKey];
        _province_name = [aDecoder decodeObjectForKey:kProvinceTextKey];
    }
    return self;
}


@end

@implementation DDEduModel

@end

@implementation DDSalaryModel

@end

@implementation DDCityModel

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.city_id forKey:kCityIdKey];
    [aCoder encodeObject:self.city_name forKey:kCityTextKey];
    
}
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _city_id = [aDecoder decodeObjectForKey:kCityIdKey];
        _city_name = [aDecoder decodeObjectForKey:kCityTextKey];
    }
    return self;
}

@end
